{% block body %}

                <div class="invoice-info">
                    <div class="invoice-name muted">
                            Pyaf
                    </div>
                    <div class="invoice-from">
                        <strong>Asistencia</strong>
                        <address>
                            <p class="muted">Consultar</p>
                        </address>
                    </div>
                    <div class="invoice-to">
                        <table>
                            <tr>
                                <th>Fecha de hoy:</th>
                                <td>{{ "now" | date('d - M - Y')}}</td>
                            </tr>
                            <tr>
                                <th>Profesor:</th>
                                <td>{{ profesor.nombreCompleto }}</td>
                            </tr>
                            <tr>
                                <th>Cód/Profesor #:</th>
                                <td>{{ profesor.id }}{{ profesor.persona.id }}</td>
                            </tr>
                        </table>
                    </div>
                    <div class="invoice-infos">
                        <span>Total</span>
                        <strong>/hs. clases</strong>
                        <span>Seleccionadas</span>
                        <address class="text-right">
                            <span id="sumaHsFiltrado"></span><strong>Hs.</strong>
{#                        
                            <div class="input-append input-prepend">
                                <span class="add-on">$</span>
                                <input type="number" name="pagoHsClase" id="pagoHsClase" class='input-small text-right' placeholder='000'>    
                                <span class="add-on">.00</span>
                            </div>
#}
                        </address>
                    </div>
                </div>
            <table id="example" class="table table-nomargin table-bordered 
                   dataTable table-striped table-hover">
                <thead>
                    <tr>
                        <th>Fecha</th>
                        <th>Horario</th>
                        <th>Cód/Clase</th>
                        <th>Dictó Clase</th>
                        <th class='tr'>Total Hs.</th>
                    </tr>
                </thead>
                <tbody>
                    {% for asistencia in asistenciaList %}
                    <tr>
                        <td class='name'>{{ asistencia.fechaClase | date('d-M-Y')}}</td>
                        <td class='name'>{{ asistencia.fechaClase | date('H:i')}}</td>
                        <td class='price'>{{ asistencia.codigoClase }}</td>
                        <td class='qty'>Sí</td>
                        <td class='total'>1</td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>

{% endblock %}      
    
{% block javascripts %}
 <script type="text/javascript" charset="utf-8">
    $(document).ready( function () {
        $('#example').dataTable( {
            "bServerSide": false,
            "oTableTools": {
                "aButtons": [
                    {
                        "sExtends": "print",
                        "sButtonText": "Imprimir"
                    }
                ]
            },
            "sDom": 'T<"clear">lfrtip',
            "bDestroy": true
        } );
        
        if($('input[type=text]', '#example_filter').val()===''){
            var suma = 0;
            var nuevo = $('#example').dataTable()._('td:nth-child(5)');
                $.each(nuevo, function(i, item) {
                    var hs = +(item);
                    suma = suma + hs;
                });
            $('#sumaHsFiltrado').text(suma);
        }
                
        $('input[type=text]', '#example_filter').eq(0).keyup(function (){
            var suma = 0;
            var nuevo = $('#example').dataTable()._('td:nth-child(5)', {"filter": "applied"});
                $.each(nuevo, function(i, item) {
                    var hs = +(item);
                    suma = suma + hs;
                });
            $('#sumaHsFiltrado').text(suma);
        })
        
    } );
    </script>
{% endblock %}    